package com.springboot.demo.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.springboot.demo.entity.Notice;
import com.springboot.demo.mapper.NoticeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeService extends ServiceImpl<NoticeMapper, Notice> {


    @Autowired
    private NoticeMapper noticeMapper;

    //获取最近一条记录
    public String getLastDate(){
        return noticeMapper.getLastDate();
    }

    //按时间顺序获取列表
    public List<Notice> getNoticeByOrder(){
        return noticeMapper.getNoticeByOrder();
    }

}
